<%@page import="be.ipl.pigolo.domaine.Partie"%>
<%@ include file="/WEB-INF/jspf/header.jspf" %>
<%@ include file="/WEB-INF/jspf/header_partie.jspf" %>
<meta http-equiv="refresh" content="5">


<title>Pigolo | Jouer</title>
</head>
<body>
	<%@ include file="/WEB-INF/jspf/navConnecter.jspf"%>
	<div class="row">
		<div class="span3"></div>
			<h1 id="titrePartie"><c:out value="${nomPartie}"/> : </h1>
			<div id="marreAuCochon">
				<h4>mare au cochons :</h4>
				<div id="afficheCochons">
					<c:if test="${listeCochons == null}">
						<center><h1>Pas de cochons</h1></center>
					</c:if>
					<c:if test="${listeCochons != null}">
						<table id="plateauDeJeu"><!-- class : listeDeCochons -->
							<tr>
								<c:set var="cptColonnes" value="-1"/>
								<c:forEach var="cochon" items="${listeCochons}">
									<c:set var="cptColonnes" value="${cptColonnes+1}"/>

									<c:if test="${cochon == null}">
										<td></td>
									</c:if>
									<c:if test="${cochon != null}">
										<td id="${cochon.getId()}" name="cochon" style="background: ${cochon.getCouleurJeu()}"><img src="img/Cochon_resize_resize.png" alt="${cochon.getId()}"/></td>
									</c:if>

									<c:if test="${cptColonnes == tailleListeCochons}">
										<c:set var="cptColonnes" value="-1"/>
										</tr><tr>
									</c:if>
								</c:forEach>
							</tr>
						</table>
					</c:if>
				</div>
			</div>
			<div id="fermiersParticipants">
				<h4>Participants :</h4>
				<table id="listeFermiers" class="">
					<c:forEach var="unFermier" items="${listeStringParticipants}">
						<tr><td><c:out value="${unFermier}" /></td></tr>
					</c:forEach>
				</table>
			</div>
			<div id="desEtLog">
				<h4>Liste de d&eacute;s :</h4>
				<div id="desAffiche">
					<table id="listeDeDes" class="">
						<c:if test="${listeDesDes==null}">
							<tr>
								<td style="background-color:blue;width:54px;height:54px;border:1px solid black"></td>
								<td style="background-color:blue;width:54px;height:54px;border:1px solid black"></td>
								<td style="background-color:blue;width:54px;height:54px;border:1px solid black"></td>
							</tr>
							<tr>
								<td style="background-color:maroon ;width:54px;height:54px;border:1px solid black"></td>
								<td style="background-color:maroon;width:54px;height:54px;border:1px solid black">EN ATTENTE</td>
								<td style="background-color:maroon;width:54px;height:54px;border:1px solid black"></td>
							</tr>
							<tr>
								<td style="background-color:red;width:54px;height:54px;border:1px solid black"></td>
								<td style="background-color:red;width:54px;height:54px;border:1px solid black"></td>
								<td style="background-color:red;width:54px;height:54px;border:1px solid black"></td>
							</tr>
							<tr>
								<td style="width:54px;height:54px"></td>
								<td style="background-color:gray;width:54px;height:54px;border:1px solid black"></td>
								<td style="width:54px;height:54px"></td>
							</tr>
						</c:if>
						<c:if test="${listeDesDes!=null}">
							<tr>
								<c:set var="cptColonnes" value="0"/>
								<c:set var="cptLignes" value="0"/>
								<c:forEach var="desValeur" items="${listeDesDes}">
									<c:set var="cptLignes" value="${cptLignes+1}"/>
									<c:if test="${cptColonnes>=0 && cptColonnes<=2}">
											<td id="${desValeur.getValeur()}"><img src="img/Des_${desValeur.getValeur()}_Vert.png" /></td>
									</c:if>
									<c:if test="${cptColonnes>=3 && cptColonnes<=5}">
											<td id="${desValeur.getValeur()}"><img src="img/Des_${desValeur.getValeur()}_Blanc.png" /></td>
									</c:if>
									<c:if test="${cptColonnes>=6 && cptColonnes<=8}">
											<td id="${desValeur.getValeur()}"><img src="img/Des_${desValeur.getValeur()}_Rouge.png" /></td>
									</c:if>
	
									<c:set var="cptColonnes" value="${cptColonnes+1}"/>

									<c:if test="${cptLignes==3}">
										<c:set var="cptLignes" value="0"/>
										</tr><tr>
									</c:if>
								</c:forEach>
							</tr>
							<c:if test="${desOrdre!=null}">
								<tr><td colspan="3"><img src="img/${desOrdre.toString()}.png" /></td></tr>
							</c:if>
						</c:if>
					</table>
				</div>
				<h4>Log de la partie :</h4>
				<div id="logAffiche">
					<textarea readonly>
						<c:if test="${journal == null}"><h1>ERREUR : Journal vide !!!</h1></c:if>
						<c:out value="${journal}"/>
					</textarea>
				</div>
			</div>
			


		<!-- /container -->
		<c:if test="${erreur != null}">
			<div id="erreur">${erreur}</div>
		</c:if>
		<c:if test="${message != null}">
			<div id="message">${message}</div>
		</c:if>
	</div>
	<%@ include file="/WEB-INF/jspf/footer.jspf" %>